package com.company.cloud.captcha.client;

import com.company.cloud.captcha.modules.api.model.CaptchaVO;
import com.company.cloud.captcha.modules.api.service.CaptchaRemoteService;
import com.company.cloud.captcha.modules.service.CaptchaService;
import com.company.cloud.common.bean.BaseClientResult;
import com.google.gson.internal.$Gson$Preconditions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Service
public class CaptchaRemoteServiceImpl implements CaptchaRemoteService {

    @Autowired
    private CaptchaService captchaService;

    @Override
    public BaseClientResult<CaptchaVO> check(CaptchaVO captchaVO) {
        try {
            return BaseClientResult.success(captchaService.check(captchaVO));
        } catch (Exception e) {
            return BaseClientResult.error(e);
        }
    }
}
